home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / utils / tweak16b / misc / vga.txt < prev    next >
Encoding:
Text File  |  1993-01-22  |  24.9 KB  |  798 lines

  1.  üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  2.             OldColor which has a path of pixels of OldColor or NewColor
  3.             with sides touching back to the seed point, (XSeed, YSeed).
  4.             Therefore, only pixels of OldColor are modified and no other
  5.             information is changed.
  6.  
  7.             SEE ALSO
  8.  
  9.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  10.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  11.             SETVIEW
  12.  
  13.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  14.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  15.             IF WHICHVGA = 0 THEN STOP
  16.             DUMMY=RES640
  17.             SETVIEW 100, 100, 539, 379
  18.             FILLVIEW 10
  19.             WHILE INKEY$ = ""
  20.             WEND
  21.             VIDEOMODESET VMODE
  22.             END
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.                                                                          63
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.           FONTGETINFO
  47.  
  48.             PROTOTYPE
  49.  
  50.             SUB FONTGETINFO (Width%, Height%)
  51.  
  52.             INPUT
  53.  
  54.             no input parameters
  55.     WEND
  56.             MOUSEEXIT
  57.             VIDEOMODESET VMODE
  58.             END
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.                                                                          86
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.           MOUSECURSORDEFAULT
  107.  
  108.             PROTOTYPE
  109.  
  110.             SUB MOUSECURSORDEFAULT ()
  111.  
  112.             INPUT
  113.  
  114.             no input parameters
  115.  
  116.             OUTPUT
  117.  
  118.             no value returned
  119.  
  120.             USAGE
  121.  
  122.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  123.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  124. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  125. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  126. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  127. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  128. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  129. $╤
  130. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  131. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  132. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  133. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  134. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  135. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  136. ░£▒
  137. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  138. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  139.       end;
  140.     end;
  141.   end;
  142.   WaitToGo;
  143. end; { UserLineStylePlay }
  144.  
  145.  
  146. procedure SayGoodbye;
  147. { Say goodbye and then exit the program }
  148. var
  149.   ViewInfo : ViewPortType;
  150. begin
  151.   MainWindow('');
  152.   GetViewSettings(ViewInfo);
  153.   SetTextStyle(TriplexFont, HorizDir, 4);
  154.   SetTextJustify(CenterText, CenterText);
  155.   with ViewInfo do
  156.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  157.   StatusLine('Press any key to quit...');
  158.   repeat until KeyPressed;
  159. end; { SayGoodbye }
  160.  
  161.  
  162. PROCEDURE SelectMode;
  163. VAR
  164.     choice1,choice2     : CHAR;
  165.    xsize,ysize            : WORD;
  166. BEGIN
  167.     (* Let's select a mode *)
  168.     ClrScr;
  169.     WriteLn('VESADEMO:');
  170.     WriteLn('1. 256 colors');
  171.     WriteLn('2. 32768 colors');
  172.     WriteLn('3. 65536 colors');
  173.     WriteLn('4. 16777216 colors');
  174.     WriteLn('Q uit');
  175.     WriteLn;
  176.     Write('Your choice: ');
  177.     REPEAT
  178.         ReadLn(choice1);
  179.       IF choice1 <> '1' THEN BEGIN
  180.           WriteLn('Sorry !');
  181.          WriteLn('This demo wasn''t written for more as 256 colors !');
  182.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  183.          WriteLn('Switching to 256 colors.');
  184.          choice1 := '1';
  185.       END;
  186.     UNTIL choice1 IN ['1'..'4','q'];
  187.     IF choice1 = 'q' THEN Halt;
  188.  
  189.     WriteLn;
  190.     WriteLn;
  191.     WriteLn('a. 320x200');
  192.     WriteLn('b. 640x480');
  193.     WriteLn('c. 800x600');
  194.     WriteLn('d. 1024x768');
  195.     WriteLn('e. 1280x1024');
  196.     WriteLn('Q uit');
  197.     WriteLn;
  198.     Write('Your choice: ');
  199.     REPEAT
  200.         ReadLn(choice2);
  201.     UNTIL choice2 IN ['a'..'e','q'];
  202.     IF choice2 = 'q' THEN Halt;
  203.  
  204.     CASE choice2 OF
  205.         'a' : BEGIN
  206.             xsize := 320;
  207.             ysize := 200;
  208.         END;
  209.         'b' : BEGIN
  210.             xsize := 640;
  211.             ysize := 480;
  212.         END;
  213.         'c' : BEGIN
  214.             xsize := 800;
  215.             ysize := 600;
  216.         END;
  217.         'd' : BEGIN
  218.             xsize := 1024;
  219.             ysize := 768;
  220.         END;
  221.         'e' : BEGIN
  222.             xsize := 1280;
  223.             ysize := 1024;
  224.         END;
  225.     END;
  226.     CASE choice1 OF
  227.         '1' : mode := FindVesaMode(xsize,ysize,8);
  228.         '2' : mode := FindVesaMode(xsize,ysize,15);
  229.         '3' : mode := FindVesaMode(xsize,ysize,16);
  230.         '4' : mode := FindVesaMode(xsize,ysize,24);
  231.     END;
  232.     IF mode = 0 THEN BEGIN
  233.         WriteLn('No such mode could be found !');
  234.         WriteLn('Switching to to 320x200.');
  235.         ReadKey;
  236.         mode := V320x200x256;
  237.     END;
  238. END;
  239.  
  240. begin { program body }
  241.   SelectMode;
  242.   Initialize;
  243.   ReportStatus;
  244.  
  245. {  AspectRatioPlay; }
  246.   FillEllipsePlay;
  247.   SectorPlay;
  248.   WriteModePlay;
  249.  
  250.   ColorPlay;
  251.   { PalettePlay only intended to work on these drivers: }
  252.   if (GraphDriver = EGA) or
  253.       (GraphDriver = EGA64) or
  254.       (GraphDriver = VGA) then
  255.      PalettePlay;
  256.   PutPixelPlay;
  257. {  PutImagePlay; }
  258.   RandBarPlay;
  259.   BarPlay;
  260.   Bar3DPlay;
  261.   ArcPlay;
  262.   CirclePlay;
  263.   PiePlay;
  264.   LineToPlay;
  265.   LineRelPlay;
  266. {  LineStylePlay; }
  267. {  UserLineStylePlay; }
  268.   TextDump;
  269.   TextPlay;
  270.   CrtModePlay;
  271.   FillStylePlay;
  272.   FillPatternPlay;
  273.   PolyPlay;
  274.   SayGoodbye;
  275. {  CloseGraph; }
  276.   CloseVesa;
  277. end.
  278. ***************************************************
  279.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  280.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  281. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  282. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  283. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  284. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  285.     Color := RandColor;
  286.     SetColor(Color);
  287.     SetFillStyle(Random(CloseDotFill)+1, Color);
  288.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  289.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  290.   until KeyPressed;
  291.   WaitToGo;
  292. end; { RandBarPlay }
  293.  
  294. procedure ArcPlay;
  295. { Draw random arcs on the screen }
  296. var
  297.   MaxRadius : word;
  298.   EndAngle : word;
  299.   ArcInfo : ArcCoordsType;
  300. begin
  301.   MainWindow('Arc / GetArcCoords demonstration');
  302.   StatusLine('Esc aborts or press a key');
  303.   MaxRadius := MaxY div 10;
  304.   repeat
  305.     SetColor(RandColor);
  306.     EndAngle := Random(360);
  307.     SetLineStyle(SolidLn, 0, NormWidth);
  308.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  309.     GetArcCoords(ArcInfo);
  310.     with ArcInfo do
  311.     begin
  312.       Line(X, Y, XStart, YStart);
  313.       Line(X, Y, Xend, Yend);
  314.     end;
  315.   until KeyPressed;
  316.   WaitToGo;
  317. end; { ArcPlay }
  318.  
  319. procedure PutPixelPlay;
  320. { Demonstrate the PutPixel and GetPixel commands }
  321. const
  322.   Seed   = 1962; { A seed for the random number generator }
  323.   NumPts = 2000; { The number of pixels plotted }
  324.   Esc    = #27;
  325. var
  326.   I : word;
  327.   X, Y, Color : word;
  328.   XMax, YMax  : integer;
  329.   ViewInfo    : ViewPortType;
  330. begin
  331.   MainWindow('PutPixel / GetPixel demonstration');
  332.   StatusLine('Esc aborts or press a key...');
  333.  
  334.   GetViewSettings(ViewInfo);
  335.   with ViewInfo do
  336.   begin
  337.     XMax := (x2-x1-1);
  338.     YMax := (y2-y1-1);
  339.   end;
  340.  
  341.   while not KeyPressed do
  342.   begin
  343.     { Plot random pixels }
  344.     RandSeed := Seed;
  345.     I := 0;
  346.     while (not KeyPressed) and (I < NumPts) do
  347.     begin
  348.       Inc(I);
  349.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  350.     end;
  351.  
  352.     { Erase pixels }
  353.     RandSeed := Seed;
  354.     I := 0;
  355.     while (not KeyPressed) and (I < NumPts) do
  356.     begin
  357.       Inc(I);
  358.       X := Random(XMax)+1;
  359.       Y := Random(YMax)+1;
  360.       Color := GetPixel(X, Y);
  361.         if Color = RandColor then
  362.           PutPixel(X, Y, 0);
  363.      end;
  364.   end;
  365.   WaitToGo;
  366. end; { PutPixelPlay }
  367.  
  368. procedure PutImagePlay;
  369. { Demonstrate the GetImage and PutImage commands }
  370.  
  371. const
  372.   r  = 20;
  373.   StartX = 100;
  374.   StartY = 50;
  375.  
  376. var
  377.   CurPort : ViewPortType;
  378.  
  379. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  380. var
  381.   Step : integer;
  382. begin
  383.   Step := Random(2*r);
  384.   if Odd(Step) then
  385.     Step := -Step;
  386.   X := X + Step;
  387.   Step := Random(r);
  388.   if Odd(Step) then
  389.     Step := -Step;
  390.   Y := Y + Step;
  391.  
  392.   { Make saucer bounce off viewport walls }
  393.   with CurPort do
  394.   begin
  395.     if (x1 + X + Width - 1 > x2) then
  396.       X := x2-x1 - Width + 1
  397.     else
  398.       if (X < 0) then
  399.         X := 0;
  400.     if (y1 + Y + Height - 1 > y2) then
  401.       Y := y2-y1 - Height + 1
  402.     else
  403.       if (Y < 0) then
  404.         Y := 0;
  405.   end;
  406. end; { MoveSaucer }
  407.  
  408. var
  409.   Pausetime : word;
  410.   Saucer    : pointer;
  411.   X, Y      : integer;
  412.   ulx, uly  : word;
  413.   lrx, lry  : word;
  414.   Size      : word;
  415.   I         : word;
  416. begin
  417.   ClearDevice;
  418.   FullPort;
  419.  
  420.   { PaintScreen }
  421.   ClearDevice;
  422.   MainWindow('GetImage / PutImage Demonstration');
  423.   StatusLine('Esc aborts or press a key...');
  424.   GetViewSettings(CurPort);
  425.  
  426.   { DrawSaucer }
  427.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  428.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  429.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  430.   Circle(StartX+10, StartY-12, 2);
  431.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  432.   Circle(StartX-10, StartY-12, 2);
  433.   SetFillStyle(SolidFill, MaxColor);
  434.   FloodFill(StartX+1, StartY+4, GetColor);
  435.  
  436.   { ReadSaucerImage }
  437.   ulx := StartX-(r+1);
  438.   uly := StartY-14;
  439.   lrx := StartX+(r+1);
  440.   lry := StartY+(r div 3)+3;
  441.  
  442.   Size := ImageSize(ulx, uly, lrx, lry);
  443.   GetMem(Saucer, Size);
  444.   GetImage(ulx, uly, lrx, lry, Saucer^);
  445. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  446.  
  447.   { Plot some "stars" }
  448.   for I := 1 to 1000 do
  449.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  450.   X := MaxX div 2;
  451.   Y := MaxY div 2;
  452.   PauseTime := 70;
  453.  
  454.   { Move the saucer around }
  455.   repeat
  456. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  457.      Delay(PauseTime);
  458. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  459.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  460.   until KeyPressed;
  461.   FreeMem(Saucer, size);
  462.   WaitToGo;
  463. end; { PutImagePlay }
  464.  
  465. procedure PolyPlay;
  466. { Draw random polygons with random fill styles on the screen }
  467. const
  468.   MaxPts = 5;
  469. type
  470.   PolygonType = array[1..MaxPts] of PointType;
  471. var
  472.   Poly : PolygonType;
  473.   I, Color : word;
  474. begin
  475.   MainWindow('FillPoly demonstration');
  476.   StatusLine('Esc aborts or press a key...');
  477.   repeat
  478.     Color := RandColor;
  479.     SetFillStyle(Random(11)+1, Color);
  480.     SetColor(Color);
  481.     for I := 1 to MaxPts do
  482.       with Poly[I] do
  483.       begin
  484.         X := Random(MaxX);
  485.         Y := Random(MaxY);
  486.       end;
  487.     FillPoly(MaxPts, Poly);
  488.   until KeyPressed;
  489.   WaitToGo;
  490. end; { PolyPlay }
  491.  
  492. procedure FillStylePlay;
  493. { Display all of the predefined fill styles available }
  494. var
  495.   Style    : word;
  496.   Width    : word;
  497.   Height   : word;
  498.   X, Y     : word;
  499.   I, J     : word;
  500.   ViewInfo : ViewPortType;
  501.  
  502. procedure DrawBox(X, Y : word);
  503. begin
  504.   SetFillStyle(Style, MaxColor);
  505.   with ViewInfo do
  506.     Bar(X, Y, X+Width, Y+Height);
  507.   Rectangle(X, Y, X+Width, Y+Height);
  508.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  509.   Inc(Style);
  510. end; { DrawBox }
  511.  
  512. begin
  513.   MainWindow('Pre-defined fill styles');
  514.   GetViewSettings(ViewInfo);
  515.   with ViewInfo do
  516.   begin
  517.     Width := 2 * ((x2+1) div 13);
  518.     Height := 2 * ((y2-10) div 10);
  519.   end;
  520.   X := Width div 2;
  521.   Y := Height div 2;
  522.   Style := 0;
  523.   for J := 1 to 3 do
  524.   begin
  525.     for I := 1 to 4 do
  526.     begin
  527.       DrawBox(X, Y);
  528.       Inc(X, (Width div 2) * 3);
  529.     end;
  530.     X := Width div 2;
  531.     Inc(Y, (Height div 2) * 3);
  532.   end;
  533.   SetTextJustify(LeftText, TopText);
  534.   WaitToGo;
  535. end; { FillStylePlay }
  536.  
  537. procedure FillPatternPlay;
  538. { Display some user defined fill patterns }
  539. const
  540.   Patterns : array[0..11] of FillPatternType = (
  541.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  542.             OldColor which has a path of pixels of OldColor or NewColor
  543.             with sides touching back to the seed point, (XSeed, YSeed).
  544.             Therefore, only pixels of OldColor are modified and no other
  545.             information is changed.
  546.  
  547.             SEE ALSO
  548.  
  549.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  550.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  551.             SETVIEW
  552.  
  553.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  554.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  555.             IF WHICHVGA = 0 THEN STOP
  556.             DUMMY=RES640
  557.             SETVIEW 100, 100, 539, 379
  558.             FILLVIEW 10
  559.             WHILE INKEY$ = ""
  560.             WEND
  561.             VIDEOMODESET VMODE
  562.             END
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.                                                                          63
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.           FONTGETINFO
  587.  
  588.             PROTOTYPE
  589.  
  590.             SUB FONTGETINFO (Width%, Height%)
  591.  
  592.             INPUT
  593.  
  594.             no input parameters
  595.     WEND
  596.             MOUSEEXIT
  597.             VIDEOMODESET VMODE
  598.             END
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.                                                                          86
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.           MOUSECURSORDEFAULT
  647.  
  648.             PROTOTYPE
  649.  
  650.             SUB MOUSECURSORDEFAULT ()
  651.  
  652.             INPUT
  653.  
  654.             no input parameters
  655.  
  656.             OUTPUT
  657.  
  658.             no value returned
  659.  
  660.             USAGE
  661.  
  662.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  663.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  664. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  665. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  666. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  667. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  668. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  669. $╤
  670. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  671. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  672. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  673. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  674. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  675. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  676. ░£▒
  677. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  678. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  679.       end;
  680.     end;
  681.   end;
  682.   WaitToGo;
  683. end; { UserLineStylePlay }
  684.  
  685.  
  686. procedure SayGoodbye;
  687. { Say goodbye and then exit the program }
  688. var
  689.   ViewInfo : ViewPortType;
  690. begin
  691.   MainWindow('');
  692.   GetViewSettings(ViewInfo);
  693.   SetTextStyle(TriplexFont, HorizDir, 4);
  694.   SetTextJustify(CenterText, CenterText);
  695.   with ViewInfo do
  696.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  697.   StatusLine('Press any key to quit...');
  698.   repeat until KeyPressed;
  699. end; { SayGoodbye }
  700.  
  701.  
  702. PROCEDURE SelectMode;
  703. VAR
  704.     choice1,choice2     : CHAR;
  705.    xsize,ysize            : WORD;
  706. BEGIN
  707.     (* Let's select a mode *)
  708.     ClrScr;
  709.     WriteLn('VESADEMO:');
  710.     WriteLn('1. 256 colors');
  711.     WriteLn('2. 32768 colors');
  712.     WriteLn('3. 65536 colors');
  713.     WriteLn('4. 16777216 colors');
  714.     WriteLn('Q uit');
  715.     WriteLn;
  716.     Write('Your choice: ');
  717.     REPEAT
  718.         ReadLn(choice1);
  719.       IF choice1 <> '1' THEN BEGIN
  720.           WriteLn('Sorry !');
  721.          WriteLn('This demo wasn''t written for more as 256 colors !');
  722.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  723.          WriteLn('Switching to 256 colors.');
  724.          choice1 := '1';
  725.       END;
  726.     UNTIL choice1 IN ['1'..'4','q'];
  727.     IF choice1 = 'q' THEN Halt;
  728.  
  729.     WriteLn;
  730.     WriteLn;
  731.     WriteLn('a. 320x200');
  732.     WriteLn('b. 640x480');
  733.     WriteLn('c. 800x600');
  734.     WriteLn('d. 1024x768');
  735.     WriteLn('e. 1280x1024');
  736.     WriteLn('Q uit');
  737.     WriteLn;
  738.     Write('Your choice: ');
  739.     REPEAT
  740.         ReadLn(choice2);
  741.     UNTIL choice2 IN ['a'..'e','q'];
  742.     IF choice2 = 'q' THEN Halt;
  743.  
  744.     CASE choice2 OF
  745.         'a' : BEGIN
  746.             xsize := 320;
  747.             ysize := 200;
  748.         END;
  749.         'b' : BEGIN
  750.             xsize := 640;
  751.             ysize := 480;
  752.         END;
  753.         'c' : BEGIN
  754.             xsize := 800;
  755.             ysize := 600;
  756.         END;
  757.         'd' : BEGIN
  758.             xsize := 1024;
  759.             ysize := 768;
  760.         END;
  761.         'e' : BEGIN
  762.             xsize := 1280;
  763.             ysize := 1024;
  764.         END;
  765.     END;
  766.     CASE choice1 OF
  767.         '1' : mode := FindVesaMode(xsize,ysize,8);
  768.         '2' : mode := FindVesaMode(xsize,ysize,15);
  769.         '3' : mode := FindVesaMode(xsize,ysize,16);
  770.         '4' : mode := FindVesaMode(xsize,ysize,24);
  771.     END;
  772.     IF mode = 0 THEN BEGIN
  773.         WriteLn('No such mode could be found !');
  774.         WriteLn('Switching to to 320x200.');
  775.         ReadKey;
  776.         mode := V320x200x256;
  777.     END;
  778. END;
  779.  
  780. begin { program body }
  781.   SelectMode;
  782.   Initialize;
  783.   ReportStatus;
  784.  
  785. {  AspectRatioPlay; }
  786.   FillEllipsePlay;
  787.   SectorPlay;
  788.   WriteModePlay;
  789.  
  790.   ColorPlay;
  791.   { PalettePlay only intended to work on these drivers: }
  792.   if (GraphDriver = EGA) or
  793.       (GraphDriver = EGA64) or
  794.       (GraphDriver = VGA) then
  795.      PalettePlay;
  796.   PutPixelPlay;
  797. {  PutImagePlay; }
  798.   RandBarPlay;
  799.   BarPlay;
  800.   Bar3DPlay;
  801.   ArcPlay;
  802.   CirclePlay;
  803.   PiePlay;
  804.   LineToPlay;
  805.   LineRelPlay;
  806. {  LineStylePlay; }
  807. {  UserLineStylePlay; }
  808.   TextDump;
  809.   TextPlay;
  810.   CrtModePlay;
  811.   FillStylePlay;
  812.   FillPatternPlay;
  813.   PolyPlay;
  814.   SayGoodbye;
  815. {  CloseGraph; }
  816.   CloseVesa;
  817. end.
  818. ***************************************************
  819.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  820.     '**********